﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using WPFLib.Navigation;

namespace NavigationDemo
{
    public class View : UserControl, INavigationNodeProxy
    {
        public View()
        {
            this.Loaded += new System.Windows.RoutedEventHandler(View_Loaded);
        }

        void View_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            if (NavigationManager.IsNavigationManagerAvailable)
            {
                NavigationManager.Instance.OnNavigationNodeLoaded(this);
            }
        }

        #region INavigationNodeProxy Members

        public INavigationNode Child
        {
            get { return this.DataContext as INavigationNode; }
        }

        #endregion

        #region INavigationNode Members

        public void RestoreState(NavigationState state)
        {
            throw new NotImplementedException();
        }

        public NavigationNodeState[] LocalState
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}
